package com.yy.wga.mp.module.merchant.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yy.wga.common.core.dto.Result;
import com.yy.wga.common.utils.mapping.BeansUtils;
import com.yy.wga.common.web.intereceptor.RequestHolder;
import com.yy.wga.merchant.feign.api.MerchantPromotePosterFeign;
import com.yy.wga.mp.common.interceptor.RequestUserHolder;
import com.yy.wga.mp.module.merchant.entity.pojo.MerchantPromotePosterDO;
import com.yy.wga.mp.module.merchant.response.MerchantPromotePosterInfoResponse;
import com.yy.wga.mp.module.merchant.service.MerchantPromotePosterService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 推广海报
 *
 * @author guochao
 * @since 2024-11-10 21:11:05
 */
@RestController
@RequestMapping("/api/merchant/promotePoster")
public class MerchantPromotePosterController {
    /**
     * 服务对象
     */
    @Resource
    private MerchantPromotePosterFeign merchantPromotePosterFeign;

    /**
     * 查询
     * @return
     */
    @GetMapping("get")
    public Result<MerchantPromotePosterInfoResponse> get() {
        Result<com.yy.wga.merchant.feign.response.MerchantPromotePosterInfoResponse> responseResult = merchantPromotePosterFeign.get();
        if (!responseResult.isSuccess()) {
            return Result.fail(responseResult.getCode(), responseResult.getMessage());
        }
        return Result.success(BeansUtils.map(responseResult.getData(), MerchantPromotePosterInfoResponse.class));
    }
}
